#@layout()
#define main()

<input type="hidden" class="layui-input" id="orderId" name="sellOrder.orderId" value="#(sellOrder.order_id??)"/>
<div class="layui-row layui-col-space1 task-row">
    #@colStart("客户",3)
    <input id="customerId" type="hidden" class="layui-input" placeHolder="必填" name="sellOrder.customerId" value="#(sellOrder.customer_id??)"/>
    <input id="customerName" type="text" class="layui-input" placeHolder="必填" name="sellOrder.customerName" value="#(sellOrder.customer_name??)"/>
    #@colEnd()
    #@colStart("开单人",3)
    <input id="originator" type="hidden" placeHolder="必填" class="layui-input" name="sellOrder.originator" value="#(sellOrder.originator??)" />
    <input id="originatorName" type="text" placeHolder="必填" class="layui-input" name="sellOrder.originatorName" value="#(sellOrder.user_name??)" />
    #@colEnd()
    #@colStart("开单时间",3)
    <input id="originatTime" type="text" lay-verType='tips' class="layui-input" name="sellOrder.originatTime" value="#(sellOrder.originat_time??)" />
    #@colEnd()
    #@colStart("发货时间",3)
    <input id="planTime" type="text" lay-verType='tips' class="layui-input" name="sellOrder.planTime" value="#(sellOrder.plan_time??)" />
    #@colEnd()
</div>

<div class="layui-row layui-col-space1 task-row">
    <!--#@colStart("实际发货时间",3)-->
    <!--<input id="actualTime" type="text" lay-verType='tips' class="layui-input" name="sellOrder.actualTime" value="#(sellOrder.actual_time??)" />-->
    <!--#@colEnd()-->
    #@colStart('结账方式',3)
    <select id="settleWay" name="sellOrder.settleWay" class="layui-input" lay-search>
        <option value="">---请选择---</option>
        #for(data:orderSettleWayMap)
        <option value="#(data.key??)" #if(sellOrder.settleWay??==data.key) selected="selected" #end>#(data.value??)</option>
        #end
    </select>
    #@colEnd()
    #@colStart("总计金额",3)
    <input id="totalAmount" type="text" lay-verType='tips' class="layui-input" name="sellOrder.totalAmount" value="#(sellOrder.total_amount??)" />
    #@colEnd()
    #@colStart("是否含发票",3)
    <select id="containBill" name="sellOrder.containBill" class="layui-input" lay-search>
        <option value="">---请选择---</option>
        #for(data:orderContainBillMap)
        <option value="#(data.key??)" #if(sellOrder.containBill??==data.key) selected="selected" #end>#(data.value??)</option>
        #end
    </select>
    #@colEnd()
    #@colStart("税率",3)
    <input id="taxRate" type="text" lay-verType='tips' class="layui-input" name="sellOrder.taxRate" value="#(sellOrder.tax_rate??)" />
    #@colEnd()
</div>

<div class="layui-row layui-col-space1 task-row">
    <!--#@colStart('单据状态',3)-->
    <!--<select id="status" name="sellOrder.status" class="layui-input" lay-search>-->
    <!--<option value="">-&#45;&#45;请选择-&#45;&#45;</option>-->
    <!--#for(data:orderStatusMap)-->
    <!--<option value="#(data.key??)" #if(sellOrder	.status??==data.key) selected="selected" #end>#(data.value??)</option>-->
    <!--#end-->
    <!--</select>-->
    <!--#@colEnd()-->
    #@colStart("物流单号",3)
    <input id="logisticsNum" type="text" lay-verType='tips' class="layui-input" name="sellOrder.logisticsNum" value="#(sellOrder.logistics_num??)" />
    #@colEnd()
    #@colStart("运费类型",3)
    <select id="carriageType" name="sellOrder.carriageType" class="layui-input" lay-search>
        <option value="">---请选择---</option>
        #for(data:orderCarriageTypeMap)
        <option value="#(data.key??)" #if(sellOrder.carriageType??==data.key) selected="selected" #end>#(data.value??)</option>
        #end
    </select>
    #@colEnd()
    #@colStart("运费",3)
    <input id="carriage" type="text" lay-verType='tips' class="layui-input" name="sellOrder.carriage" value="#(sellOrder.carriage??)" />
    #@colEnd()
    #@colStart("实际运费",3)
    <input id="realcarriage" type="text" lay-verType='tips' class="layui-input" name="sellOrder.realCarriage" value="#(sellOrder.realCarriage??)" />
    #@colEnd()
</div>

<span class="layui-badge layui-bg-green">订单明细</span>
<!-- 支付信息表格列表 -->
<div class="layui-row  f-index-toolbar">
    <div class="layui-col-xs12">
        <table id="maingrid2" lay-filter="maingrid"></table>
    </div>
</div>

<span class="layui-badge layui-bg-green">支付明细</span>
<!-- 订单项表格列表 -->
<div class="layui-row  f-index-toolbar">
    <div class="layui-col-xs12">
        <table id="maingrid" lay-filter="maingrid"></table>
    </div>
</div>

#end

#define js()
<script>
    gridArgs.title='订单明细';
    gridArgs.dataId='detail_id';
    gridArgs.gridDivId ='maingrid';
    initGrid({id : 'maingrid2'
        ,elem : '#maingrid2'
        ,cellMinWidth: 80
        ,cols : [ [
            {title: '主键',field : 'detail_id',width : 35,checkbox : true},
            {title: '序号',type:'numbers',width:35},
            {title: '物品', field: 'entity_name' },
            {title: '所属上级', field: 'par_entity_name'},
            {title: '适用车型', field: 'car_type'},
            {title: '计量单位', field: 'unit'},
            {title: '数量', field: 'amount'},
            {title: '价格', field: 'price'},
            {title: '折扣', field: 'discount'},
            {title: '金额', field: 'sum_money'},
            {title: '备注', field: 'remark'},
        ] ]
        ,url:'#(path)/erp/order/sellDetail/list?orderId='+$("#orderId").val()
        ,where:{"object":"sys_tree","primaryKey":gridArgs.dataId}
        ,searchForm : 'searchForm'
    });

    gridArgs.title='付款明细';
    gridArgs.dataId='detail_id';
    gridArgs.gridDivId ='maingrid';
    initGrid({id : 'maingrid'
        ,elem : '#maingrid'
        ,cellMinWidth: 80
        ,cols : [ [
            {title: '主键',field : 'detail_id',width : 35,checkbox : true},
            {title: '序号',type:'numbers',width:35},
            {title: '支付编码', field: 'pay_code' },
            {title: '支付类型', field: 'pay_type' },
            {title: '账号', field: 'account' },
            {title: '支付金额', field: 'sum_money'},
            <!--{title: '支付方', field: 'pay_men'},-->
            <!--{title: '收入方', field: 'receive_men'},-->
            <!--{title: '交易时间', field: 'trans_time'},-->
        ] ]
        ,url:'#(path)/erp/order/incomeDetail/list?orderId='+$("#orderId").val()
        ,where:{"object":"sys_tree","primaryKey":gridArgs.dataId}
        ,searchForm : 'searchForm'
    });
</script>

#end